import type  { userType } from "../assets/user";

let currentUser : userType ;

const setCurrentUserState = (user: userType) => {
    currentUser = user;
};

const getCurrentUserState = () : userType => {
    if (!currentUser) {
        throw new Error("当前用户未初始化！");
    }
    return currentUser;
};

export {
    setCurrentUserState,
    getCurrentUserState,
};
